Skip to content

Subtract min from the accessibilityValue percentage on iOS - #60016

Open
faciledictu wants to merge 1 commit into
react:mainfrom
faciledictu:fix/ios-accessibility-value-percentage
Open

faciledictu wants to merge 1 commit into
react:mainfrom
faciledictu:fix/ios-accessibility-value-percentage

Conversation

@faciledictu

Copy link
Copy Markdown
Contributor

Summary:

Fixes #60015.

On iOS the value of a view with accessibilityValue={{ min, max, now }} was now / (max - min): { min: 10, max: 20, now: 15 } was read as "150%", and min == max gave "+∞".

It is now (now - min) / (max - min). There is no value when the range is empty or now is outside it, the same condition as on Android and in the old architecture.

Changelog:

[IOS] [FIXED] - The accessibilityValue percentage takes min into account

Test Plan:

Added tests to RCTViewComponentViewTests; they fail without this change and pass with it. Checked on iOS with https://github.com/faciledictu/rn-a11y-value-percentage-repro: V2 is "50%", V3 "0%", and V5, V6 and V7 have no value.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 15, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Nov 15, 2026
@github-actions

Copy link
Copy Markdown

Visual regression

No visual differences at 5b8da7f136d3.

android: no capture

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS: accessibilityValue percentage is wrong when min is not 0

1 participant